<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Đăng ký thành viên</title>
</head>

<body>
  <?php
				@session_start();
				if(isset($_GET["themgiohang"]))
				{
					$id=$_GET["themgiohang"];
					if(isset($_SESSION['giohang']) && is_array($_SESSION['giohang']))
					{
						$count= count($_SESSION['giohang']);
						$flag=false;
						for ($i = 0; $i < $count; $i++)
						{ 
						if($_SESSION['giohang'][$i]["id"] == $id){
							$_SESSION['giohang'][$i]["soluong"] +=1;
									$flag=true;

									break;
							}
							}
						if($flag == false)
						{$_SESSION['giohang'][$count]["id"]=$id;
							$_SESSION['giohang'][$count]["soluong"]=1;
							}
						}else {
							$_SESSION['giohang']=array();
							$_SESSION['giohang'][0]["id"]=$id;
							$_SESSION['giohang'][0]["soluong"]=1;
							echo "<script> comfirm('Please enter some text!');</script>";

							}
						header("Location: cts.php?id=47");
						$sl = $_SESSION['giohang'][0]["soluong"];
						echo "yyyyyyyyyy".$sl;
				}

?>
<?php 
	require ('admin/models/m_nguoidung.php'); 
	require ('admin/models/sharefunction.php'); 
	include('login.php');
	dbconnect();
	$ID_AI = getid_auto_increment(); 
	$tts=getbyall_t();	
	
	if (isset($_POST['ok']))
			{  
				insert_user($_POST); 
				$hoten = $_POST['Ho_va_ten'];
				$ID_AI = getid_auto_increment(); 
				include('phpmailer/dangky.php');
			  
			}
	require ('v_dangky.php'); 
	
?>
</body>
</html>